package backend_0010;

public class Oblong implements Perarea{
    private double length;
    private double height;

    public Oblong(double length, double height){
        this.length=length;
        this.height=height;
    }
    public double get_area(){
        return length*height;
    }

    @Override
    public double get_perimeter() {
        return (length+height)*2;
    }

    public static void main(String[] args) {
        Oblong oblong=new Oblong(10,5);
        Perarea perarea=oblong;
        System.out.println("长方形的面积："+perarea.get_area());
        System.out.println("长方形的周长："+perarea.get_perimeter());
    }
}
